/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="goods_type_value")
public class GoodsTypeValue implements Serializable {
	public GoodsTypeValue() {
	}
	
	private int id;
	
	private cn.imvc.app.entities.Goods goods;
	
	private cn.imvc.app.entities.TypeValue typeValue;
	
	private String typeValueName;
	
	private cn.imvc.app.entities.TypeClass typeClass;
	
	private String typeClassName;
	
	private String typeClassCode;
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_GOODSTYPEVALUE_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_GOODSTYPEVALUE_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 类型名称
	 */
	public void setTypeValueName(String value) {
		this.typeValueName = value;
	}
	
	/**
	 * 类型名称
	 */
	@Column(name="typeValueName", nullable=true, length=255)	
	public String getTypeValueName() {
		return typeValueName;
	}
	
	/**
	 * 类型类别名称
	 */
	public void setTypeClassName(String value) {
		this.typeClassName = value;
	}
	
	/**
	 * 类型类别名称
	 */
	@Column(name="typeClassName", nullable=true, length=255)	
	public String getTypeClassName() {
		return typeClassName;
	}
	
	/**
	 * 类型类别编码
	 */
	public void setTypeClassCode(String value) {
		this.typeClassCode = value;
	}
	
	/**
	 * 类型类别编码
	 */
	@Column(name="typeClassCode", nullable=true, length=255)	
	public String getTypeClassCode() {
		return typeClassCode;
	}
	
	public void setGoods(cn.imvc.app.entities.Goods value) {
		this.goods = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Goods.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="goodsId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Goods getGoods() {
		return goods;
	}
	
	public void setTypeValue(cn.imvc.app.entities.TypeValue value) {
		this.typeValue = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.TypeValue.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="typeValueId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.TypeValue getTypeValue() {
		return typeValue;
	}
	
	public void setTypeClass(cn.imvc.app.entities.TypeClass value) {
		this.typeClass = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.TypeClass.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="typeClassId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.TypeClass getTypeClass() {
		return typeClass;
	}
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("GoodsTypeValue[ ");
			sb.append("Id=").append(getId()).append(" ");
			if (getGoods() != null)
				sb.append("Goods.Persist_ID=").append(getGoods().toString(true)).append(" ");
			else
				sb.append("Goods=null ");
			if (getTypeValue() != null)
				sb.append("TypeValue.Persist_ID=").append(getTypeValue().toString(true)).append(" ");
			else
				sb.append("TypeValue=null ");
			sb.append("TypeValueName=").append(getTypeValueName()).append(" ");
			if (getTypeClass() != null)
				sb.append("TypeClass.Persist_ID=").append(getTypeClass().toString(true)).append(" ");
			else
				sb.append("TypeClass=null ");
			sb.append("TypeClassName=").append(getTypeClassName()).append(" ");
			sb.append("TypeClassCode=").append(getTypeClassCode()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
